
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Xml;



namespace Swaf.Gui
{
	/// <summary>
	/// Summary description for Layout.
	/// </summary>
	public interface ILayoutManager : IGuiWidget
	{
		IGuiWidget getNamedItem(string name);

		/// <summary>
		/// Called by the given layout container to allow the layout manager to apply any
		/// of its own drawing or arranging of non-child elements.  This is typically the opportunity
		/// for the layout manager to draw borders or background colors to accentuate the children it
		/// is laying out.
		/// </summary>
		/// <param name="context">GUI environment specific.  Each GUI implementation (such as win forms
		/// or DHTML) provides some kind of object that can be used to do drawing, etc.</param>
		void applyContent(object context);

		/// <summary>
		/// Adds a new child to the layout manager, using the provided layoutInfo to position the child
		/// properly.
		/// </summary>
		/// <remarks>Each layout manager defines what attributes can be defined in the layoutInfo</remarks>
		/// <param name="child"></param>
		/// <param name="layoutInfo"></param>
		void addChild(object child, XmlElement layoutInfo);

		/// <summary>
		/// Adds a new child to the layout manager, using a location name to specify a defined location
		/// in the layout manager to place the child in.
		/// </summary>
		/// <param name="child">The child to add, which should be specific to the general GUI 
		/// environment the layout manager is being used in</param>
		/// <param name="location">A <c>Namespace</c> type location that will regress into child locations
		/// to find the ultimate location.</param>
		void addChild(object child, string location);

		/// <summary>
		/// Removes the child from the layout manager.
		/// </summary>
		/// <param name="child"></param>
		void removeChild(object child);

		/// <summary>
		/// Ensures that the given child is visible on the screen.  For layout managers
		/// that always show their children, this shouldn't be a problem.
		/// </summary>
		/// <param name="child"></param>
		void showChild(object child);
	}
}
